# Maintainer: Bruno Pagani <archange@archlinux.org>

_pkg=pyogrio
pkgname=python-${_pkg}
pkgver=0.5.1
pkgrel=2
pkgdesc="Vectorized vector I/O using OGR"
arch=(loong64 x86_64)
url="https://pyogrio.readthedocs.io/"
license=(MIT)
depends=(gdal python-certifi python-numpy)
makedepends=(cython python-setuptools python-versioneer)
checkdepends=(python-pytest)
source=(https://files.pythonhosted.org/packages/source/${_pkg::1}/${_pkg}/${_pkg}-${pkgver}.tar.gz)
sha256sums=('c34cda21771b21ad7989b61a72f860e1b505cd1602221df8d61d167fdbf69e33')

build() {
  cd ${_pkg}-${pkgver}
  python setup.py build
}

# ModuleNotFoundError: No module named 'pyogrio._ogr' even when setting PYTHONPATH or using a venv
#check() {
#  cd ${_pkg}-${pkgver}
#  pytest -vv --color=yes
#}

package() {
  cd ${_pkg}-${pkgver}
  python setup.py install --prefix=/usr --root="${pkgdir}" --skip-build --optimize=1
  install -Dm644 LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgname}
}
